<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>主菜单 - 在线打字练习</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background: #f0f0f0;
            min-height: 100vh;
            margin: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }
        .main-container {
            background: #fff;
            padding: 40px 30px;
            border-radius: 12px;
            box-shadow: 0 0 16px rgba(0,0,0,0.08);
            display: flex;
            flex-direction: column;
            align-items: center;
        }
        h1 {
            margin-bottom: 32px;
        }
        .menu-btn {
            width: 220px;
            padding: 18px 0;
            margin: 12px 0;
            font-size: 20px;
            border: none;
            border-radius: 8px;
            background: #007bff;
            color: #fff;
            cursor: pointer;
            transition: background 0.2s;
        }
        .menu-btn:hover {
            background: #0056b3;
        }
        #logout-btn {
            margin-top: 30px;
            background: #dc3545;
        }
        #logout-btn:hover {
            background: #a71d2a;
        }
    </style>
</head>
<body>
    <!-- 主菜单页面，提供各类打字练习入口和退出登录功能 -->
    <div class="main-container">
        <!-- 标题 -->
        <h1>在线打字练习 - 主菜单</h1>
        <!-- 各功能入口按钮 -->
        <button class="menu-btn" onclick="location.href='zh.html'">中文文章打字练习</button>
        <button class="menu-btn" onclick="location.href='en.html'">英文文章打字练习</button>
        <button class="menu-btn" onclick="location.href='game.html'">打字小游戏</button>
        <button class="menu-btn" onclick="location.href='wrongbook.html'">错题专项练习</button>
        <!-- 退出登录按钮 -->
        <button id="logout-btn" class="menu-btn" onclick="logout()">退出登录</button>
    </div>
    <script>
        // 登录校验，未登录自动跳转到登录页
        if (!localStorage.getItem('isLoggedIn')) {
            window.location.href = 'login.html';
        }
        /**
         * 退出登录，清除登录状态并跳转到登录页
         */
        function logout() {
            localStorage.removeItem('isLoggedIn');
            window.location.href = 'login.html';
        }
    </script>
</body>
</html> 